package pbbltobpel.model.steps;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import pbbltobpel.model.PartnerLinkPartnerRole;
import pbbltobpel.model.Variable;

public class InvokeStep extends Step {
	private PartnerLinkPartnerRole link;
	private String operation;
	private String portType;
	private Variable inputVariable;
	private Variable outputVariable;
	
	public String getPortType() {
		return portType;
	}
	
	public void setPortType(String portType) {
		this.portType = portType;
	}
	
	public Variable getOutputVariable() {
		return outputVariable;
	}
	public void setOutputVariable(Variable outputVariable) {
		this.outputVariable = outputVariable;
	}
	public Variable getInputVariable() {
		return inputVariable;
	}
	public void setInputVariable(Variable inputVariable) {
		this.inputVariable = inputVariable;
	}
	public String getOperation() {
		return operation;
	}
	public void setOperation(String operation) {
		this.operation = operation;
	}
	public PartnerLinkPartnerRole getLink() {
		return link;
	}
	public void setLink(PartnerLinkPartnerRole link) {
		this.link = link;
	}
	
	@Override
	public Element getXmlElement(Document doc) {
		Element element = doc.createElement("bpel:invoke");
		element.setAttribute("name", getName());
		element.setAttribute("partnerLink", link.getName());
		element.setAttribute("portType", getPortType());
		element.setAttribute("operation", operation);
		element.setAttribute("inputVariable", inputVariable.getName());
		element.setAttribute("outputVariable", outputVariable.getName());
		return element;
	}
}
